#include <iostream>
#include <unistd.h>
#include <cstring>
#include "ShareMemory.hpp"
#include "Time.hpp"

int main()
{
    gShareMemory.CreateShm();
    gShareMemory.AttachShm();
    struct data *image = (struct data*)gShareMemory.GetAddr();

    while(true)
    {
        printf("status: %s\n", image->status);
        printf("lsttime: %s\n", image->lsttime);
        printf("image: %s\n", image->image);
        strcpy(image->status, "过期");
        sleep(5);

    }

    gShareMemory.DetachShm();
    gShareMemory.DeleteShm();
    return 0;
}